package com.kaifamiao.www.Thread.do0926;

public class TestSD {
    public static void main(String[] args) {
        SychronizedDemo sd = new SychronizedDemo();

//        Thread td = new Thread(sd,"方法一");
//        Thread t1 = new Thread(sd,"方法二");
//        Thread t2 = new Thread(sd,"方法三");
//        Thread t3 = new Thread(sd,"方法四");
//        Thread t4 = new Thread(sd,"方法五");
        Thread td = new Thread(sd);
        Thread t1 = new Thread(sd);
        Thread t2 = new Thread(sd);
        Thread t3 = new Thread(sd);
        Thread t4 = new Thread(sd);
        td.start();
        t1.start();
        t2.start();
        t3.start();
        t4.start();
//        try {
//            td.join();
//            t1.join();
//            t2.join();
//            t3.join();
//            t4.join();
//
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        System.out.println(SychronizedDemo.getCount());

    }
}
